package cn.wolfcode.mapper;

import cn.wolfcode.domain.Notice;
import cn.wolfcode.util.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NoticeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Notice notice);

    Notice selectByPrimaryKey(Long id);

    List<Notice> selectAll();

    int updateByPrimaryKey(Notice notice);

    List<Notice> selectForList(QueryObject qo);
    //根据员工id能够查询到他阅读公告的情况,返回公告id用于做是否已读
    List<Long> selectForReadList(Long empId);
    //保存员工阅读公告的情况
    void saveRead(@Param("noticeId") Long noticeId, @Param("empId") Long empId);
    //根据id删除一条公告被阅读的所有情况
    void deleteEmployeeReadNotice(Long id);
}
